package com.zmn.plat.common.dictionary;

/**
 * 渠道推广产品枚举
 *
 * @author yangshuangping
 * @since 2021/06/17 18:43
 */
public enum ChannelPromotionBrandEnum {

    /**
     * values
     */
    ZMN(10, "啄木鸟"),
    NO_ZMN(20, "非啄木鸟");

    private Integer code;
    private String name;

    ChannelPromotionBrandEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ChannelPromotionBrandEnum of(Integer code) {
        if (code == null) {
            return null;
        }
        switch (code) {
            case 10:
                return ZMN;
            case 20:
                return NO_ZMN;
            default:
                return null;
        }
    }

    public static String getName(Integer code) {
        ChannelPromotionBrandEnum of = of(code);
        return of == null ? null : of.getName();
    }

    public static ChannelPromotionBrandEnum[] list() {
        return new ChannelPromotionBrandEnum[]{ZMN, NO_ZMN};
    }
}
